<template>
	<t-modal
        destroyOnClose
        :title="title"
        :width="1000"
        :visible="visible"
        :maskClosable="true"
        @cancel="() => {$emit('cancel')}"
    >
        <template slot="footer">
            <a-button key="back" @click="() => {$emit('cancel')}">
            关闭
            </a-button>
        </template>
        <a-table
            ref="table"
            size="small"
            :columns="columns"
            :data-source="dataSource"
            :pagination="false"
            rowKey="uuid"
        >
            <span slot="renderType" slot-scope="text, record">
                <a-tag :color="text === 1 || text === '1' ? 'green' : 'blue'">
                    {{ text === 1 || text === "1" ? '组织' : '用户' }}
                </a-tag>
            </span>
        </a-table>
	</t-modal>
</template>

<script>
	export default {
		props: {
			visible: {
				type: Boolean,
				required: true
			},
            dataSource: {
                type: Array,
            }
		},
		data() {
			return {
				title:'同步结果',
                columns: [
                    {
                        title: "同步类型",
                        align: "center",
                        dataIndex: "thirdDataType",
                        scopedSlots: { customRender: "renderType" }
                    },
                    {
                        title: "总数",
                        align: "center",
                        dataIndex: "dingdingTotal"
                    },
                    {
                        title: "同步成功数",
                        align: "center",
                        dataIndex: "synSuccessTotle"
                    },
                    {
                        title: "同步失败数",
                        align: "center",
                        dataIndex: "synErrorTotle"
                    },
                    {
                        title: "同步时间",
                        align: "center",
                        dataIndex: "createTime",
                    },
                ],
                data: [
                    {
                        uuid: '123',
                        syncType: '组织',
                        allNum: 20,
                        successNum: 10,
                        errorNum: 5,
                        noNum: 5,
                        syncTime: '2023-10-31',
                    },
                    {
                        uuid: '456',
                        syncType: '用户',
                        allNum: 60,
                        successNum: 40,
                        errorNum: 15,
                        noNum: 5,
                        syncTime: '2023-10-31',
                    },
                ],
			};
		},
		methods: { },
	};
</script>
<style lang="less" scoped>
	
</style>
